import request from '@/utils/request'

export async function getCalendarTypeListApi(params) {
  var resp = await request({
    url: '/calendars/type_list/',
    method: 'get',
    params
  })
  return resp;
}

export async function getCalendarTypeApi(id) {
  var resp = await request({
    url: '/calendars/type_list/' + id + '/',
    method: 'get'
  })
  return resp;
}

export async function createCalendarTypeApi(data) {
  var resp = await request({
    url: '/calendars/type_list/',
    method: 'post',
    data
  })
  return resp;
}

export async function updateCalendarTypeApi(id, data) {
  var resp = await request({
    url: '/calendars/type_list/' + id + '/',
    method: 'put',
    data
  })
  return resp;
}

export async function deleteCalendarTypeApi(id) {
  var resp = await request({
    url: '/calendars/type_list/' + id + '/',
    method: 'delete'
  })
  return resp;
}

export async function generateCalendarApi(data) {
  var resp = await request({
    url: '/calendars/generate_calendar/',
    method: 'post',
    data
  })
  return resp
}

export async function extendCalendarApi(data) {
  var resp = await request({
    url: '/calendars/extend_calendar/',
    method: 'post',
    data
  })
  return resp
}

export async function getCalendarApi(params) {
  var resp = await request({
    url: '/calendars/calendar/',
    method: 'get',
    params
  })
  return resp;
}

export async function updateCalendarApi(data) {
  var resp = await request({
    url: '/calendars/calendar/',
    method: 'post',
    data
  })
  return resp;
}
